<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC 
	"-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<html xmlns='http://www.w3.org/1999/xhtml' >
  <head>
    <link 
			href="http://www.holisticware.net/HolisticWare.css" 
			rel="stylesheet" type="text/css" 
		/>
	<style type="text/css">
		*
		{
			font-family : Verdana, Arial, Helvetica, Tahoma, Segoe, sans-serif;
			font-size : small;
			text-align: left;
			vertical-align: top;
			color:#4F0080;
		}
		pre
		{
			font-family : Courier;
			font-size: x-small;
		}
	</style>
    <meta 
			name = "Description"  
			content = "holisticware, HolisticWare - Design Rules And Recommendations for .net " 
			/>
		<meta 
			name = "Keywords" 
			content="holisticware, HolisticWare - Design Rules And Recommendations for .net "
			/>
		<meta 
			id="Meta1"  
			content="all"
			/>				
		<link 
			rel="SHORTCUT ICON" 
			href="c:/etc/templates/HolisticWare.favicon.dynamic_drive.ico" 
		/>
    <title> 
    HolisticWare - Design Rules And Recommendations for .net 
    </title>
  </head>
	<body>
		<h1>
    		Requirements - Use Cases</h1>

		<h2>
			Trace changes</h2>
		<ul>
			<li>on files<br />
		<p>
			Each FreePBX/TrixBox/Elastix submit changes asterisk files:
		</p>
		<p>
		command:
		</p>
		<pre>
find /etc/ -type f -printf &#39;%TY-%Tm-%Td %TT %p\n&#39; | sort </pre>
		<p>
		output:
		</p>
<pre>
2010-06-02 12:28:01 /etc/asterisk/localprefixes.conf
2010-06-02 12:34:25 /etc/asterisk/vm_email.inc2010-06-02 12:34:25 /etc/asterisk/vm_general.inc
2010-06-02 12:34:25 /etc/asterisk/voicemail.conf
2010-06-02 13:04:32 /etc/asterisk/chan_dahdi_additional.conf
2010-06-02 13:04:32 /etc/asterisk/extensions_additional.conf
2010-06-02 13:04:32 /etc/asterisk/features_applicationmap_additional.conf
2010-06-02 13:04:32 /etc/asterisk/features_featuremap_additional.conf
2010-06-02 13:04:32 /etc/asterisk/features_general_additional.conf
2010-06-02 13:04:32 /etc/asterisk/iax_additional.conf
2010-06-02 13:04:32 /etc/asterisk/iax_general_additional.conf
2010-06-02 13:04:32 /etc/asterisk/iax_registrations.conf
2010-06-02 13:04:32 /etc/asterisk/indications.conf
2010-06-02 13:04:32 /etc/asterisk/meetme_additional.conf
2010-06-02 13:04:32 /etc/asterisk/queues_additional.conf
2010-06-02 13:04:32 /etc/asterisk/queues_general_additional.conf
2010-06-02 13:04:32 /etc/asterisk/sip_additional.conf
2010-06-02 13:04:32 /etc/asterisk/sip_general_additional.conf
2010-06-02 13:04:32 /etc/asterisk/sip_registrations.conf
</pre>
		<p>
			Grep script!!</p>
		<h3>
			&nbsp;</h3>
			</li>
			<li>on database<br />
			MySQL tracing enabled:<br />
			<pre>
#!/bin/bash

IP=`ifconfig $1 | grep "inet addr" | gawk -F: '{print $2}' | gawk '{print $1}'`
echo $IP
IP=`grep IPADDR /etc/sysconfig/network-scripts/ifcfg-eth0 |awk -F= '{print $2}'`
echo $IP
IP=` ifconfig eth0 |grep "inet addr" |awk '{print $2}' |awk -F: '{print $2}'`
echo $IP

cp /etc/my.cnf /etc/my.cnf.original.mc++

sed "/old_passwords=1/ a port=3306"  \
	/etc/my.cnf         > /etc/my.cnf.mc++.01
sed "/old_passwords=1/ a bind-address=$IP" \
	/etc/my.cnf.mc++.01 > /etc/my.cnf.mc++.02
sed "/old_passwords=1/ a log = /var/log/mysql/mysql.log" \
	/etc/my.cnf.mc++.02 > /etc/my.cnf.mc++.03
cat /etc/my.cnf.mc++.03


/bin/cp -f /etc/my.cnf.mc++.03 /etc/my.cnf
mkdir /var/log/mysql/
touch /var/log/mysql/mysql.log

chown mysql /var/log/mysql
chown mysql /var/log/mysql/*
chmod 700 /var/log/mysql
chmod 700 /var/log/mysql/*

service mysqld restart
cat /var/log/mysql/mysql.log

MYSQL="mysql -u root -peLaStIx.2oo7"
$MYSQL -e "GRANT ALL PRIVILEGES ON *.* TO root@"192.168.0.15" identified by  'eLaStIx.2oo7';"

$MYSQL -e "GRANT ALL PRIVILEGES ON *.* TO root@"192.168.0.17" identified by  'eLaStIx.2oo7';"

# does not work;
# $MYSQL "update db set Host='"$IP"' where Db='asterisk';"
# $MYSQL "update user set Host='192.168.102.191' where user='root';"
; ERROR 1102 (42000): Incorrect database name 'update db set Host='192.168.0.36' where Db='asterisk';'
; ERROR 1102 (42000): Incorrect database name 'update user set Host='192.168.102.191' where user='root';'
			</pre>
			</li>
			<li>
			Test MySQL asterisk DB
			<pre>
#!/bin/bash

MYSQL="mysql -u root -peLaStIx.2oo7"
 
$MYSQL -e "show databases;"
$MYSQL -e "use asterisk; show tables;"
$MYSQL -e "use asterisk; select * from sip;"
$MYSQL -e "use asterisk; select * from iax;"
			</pre>
			</li>
		</ul>
		<h2>
			Database</h2>
		<ul>
			<li>devices<br />
			<pre>
[root@elastix ~]# $MYSQL -e "use asterisk; select * from devices;"
+------+------+-----------+------------+------+-------------+---------------+
| id   | tech | dial      | devicetype | user | description | emergency_cid |
+------+------+-----------+------------+------+-------------+---------------+
| 1001 | iax2 | IAX2/1001 | fixed      | 1001 | Moljac      |               |
| 5001 | sip  | SIP/5001  | fixed      | 5001 | Moljac      |               |
| 5002 | sip  | SIP/5002  | fixed      | 5002 | Lega        |               |
| 1002 | iax2 | IAX2/1002 | fixed      | 1002 | Lega        |               |
+------+------+-----------+------------+------+-------------+---------------+
			</pre>
			</li>
		</ul>
		<p>
			&nbsp;</p>

	<!-- HolisticWare.Text.Begin-->
		<ul>
			<li>Extensions Add<ul>
				<li>SIP<ul>
					<li>database table<br />
					<pre>
[root@elastix ~]# $MYSQL -e "use asterisk; select * from sip;"
+------+-------------+-----------------+-------+
| id   | keyword     | data            | flags |
+------+-------------+-----------------+-------+
| 5001 | record_in   | Adhoc           |     0 |
| 5001 | callerid    | device <5001>   |     0 |
| 5001 | account     | 5001            |     0 |
| 5001 | permit      | 0.0.0.0/0.0.0.0 |     0 |
| 5001 | deny        | 0.0.0.0/0.0.0.0 |     0 |
| 5001 | mailbox     | 5001@device     |     0 |
| 5002 | record_in   | Adhoc           |     0 |
| 5002 | account     | 5002            |     0 |
| 5002 | callerid    | device <5002>   |     0 |
| 5002 | permit      | 0.0.0.0/0.0.0.0 |     0 |
| 5002 | deny        | 0.0.0.0/0.0.0.0 |     0 |
| 5002 | mailbox     | 5002@device     |     0 |
| 5002 | accountcode |                 |     0 |
| 5002 | allow       |                 |     0 |
| 5002 | dial        | SIP/5002        |     0 |
| 5001 | accountcode |                 |     0 |
| 5001 | dial        | SIP/5001        |     0 |
| 5001 | allow       |                 |     0 |
| 5001 | disallow    |                 |     0 |
| 5001 | pickupgroup |                 |     0 |
| 5001 | callgroup   |                 |     0 |
| 5001 | qualify     | yes             |     0 |
| 5001 | port        | 5060            |     0 |
| 5001 | nat         | yes             |     0 |
| 5001 | type        | friend          |     0 |
| 5001 | host        | dynamic         |     0 |
| 5001 | context     | from-internal   |     0 |
| 5001 | canreinvite | no              |     0 |
| 5001 | dtmfmode    | rfc2833         |     0 |
| 5001 | secret      | 5001            |     0 |
| 5002 | disallow    |                 |     0 |
| 5002 | pickupgroup |                 |     0 |
| 5002 | callgroup   |                 |     0 |
| 5002 | qualify     | yes             |     0 |
| 5002 | port        | 5060            |     0 |
| 5002 | nat         | yes             |     0 |
| 5002 | type        | friend          |     0 |
| 5002 | host        | dynamic         |     0 |
| 5002 | context     | from-internal   |     0 |
| 5002 | canreinvite | no              |     0 |
| 5002 | dtmfmode    | rfc2833         |     0 |
| 5002 | secret      | 5002            |     0 |
| 5001 | record_out  | Adhoc           |     0 |
| 5002 | record_out  | Adhoc           |     0 |
+------+-------------+-----------------+-------+
					</pre>
					</li>
					<li>database log <br/>
					<pre>
                     19 Query       INSERT INTO users (extension,password,name,voicemail,ringtimer,noanswer,recording,outboundcid,sipname) values ("1111", "", "robby", "novm", "0", "", "out=Adhoc|in=Adhoc", "", "")
                     19 Query       INSERT INTO devices (id,tech,dial,devicetype,user,description,emergency_cid) values ("1111","sip","SIP/1111","fixed","1111","robby","")
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','secret','1111')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','dtmfmode','rfc2833')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','canreinvite','no')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','context','from-internal')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','host','dynamic')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','type','friend')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','nat','yes')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','port','5060')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','qualify','yes')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','callgroup','')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','pickupgroup','')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','disallow','')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','allow','')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','dial','SIP/1111')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','accountcode','')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','mailbox','1111@device')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','deny','0.0.0.0/0.0.0.0')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','permit','0.0.0.0/0.0.0.0')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','account','1111')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','callerid','device <1111>')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','record_in','Adhoc')
                     19 Query       INSERT INTO sip (id, keyword, data) values ('1111','record_out','Adhoc')

			IPINSERT INTO sip (id, keyword, data) values ('6666','secret','6666')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','dtmfmode','rfc2833')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','canreinvite','no')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','context','from-internal')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','host','dynamic')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','type','friend')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','nat','yes')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','port','5060')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','qualify','yes')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','callgroup','')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','pickupgroup','')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','disallow','')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','allow','')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','dial','SIP/6666')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','accountcode','')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','mailbox','6666@device')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','deny','0.0.0.0/0.0.0.0')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','permit','0.0.0.0/0.0.0.0')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','account','6666')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','callerid','device <6666>')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','record_in','Adhoc')
                     12 Query       INSERT INTO sip (id, keyword, data) values ('6666','record_out','Adhoc')
					</pre>
					
					</li>
					<li>files<br />
					<pre>
;/etc/asterisk/sip_additional.conf

[5001]
deny=0.0.0.0/0.0.0.0
type=friend
secret=5001
qualify=yes
port=5060
pickupgroup=
permit=0.0.0.0/0.0.0.0
nat=yes
mailbox=5001@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/5001
context=from-internal
canreinvite=no
callgroup=
callerid=device <5001>
accountcode=
call-limit=50

					</pre>
					</li>
					</ul>
				</li>
				<li>IAX<ul>
					<li>database table<br />
					<pre>
[root@elastix ~]# $MYSQL -e "use asterisk; select * from iax;"
+------+-------------+----------------------+-------+
| id   | keyword     | data                 | flags |
+------+-------------+----------------------+-------+
| 1001 | record_in   | Adhoc                |     0 |
| 1001 | setvar      | REALCALLERIDNUM=1001 |     0 |
| 1001 | callerid    | device <1001>        |     0 |
| 1001 | account     | 1001                 |     0 |
| 1001 | permit      | 0.0.0.0/0.0.0.0      |     0 |
| 1001 | deny        | 0.0.0.0/0.0.0.0      |     0 |
| 1001 | mailbox     | 1001@device          |     0 |
| 1001 | accountcode |                      |     0 |
| 1001 | dial        | IAX2/1001            |     0 |
| 1001 | allow       |                      |     0 |
| 1001 | disallow    |                      |     0 |
| 1001 | qualify     | yes                  |     0 |
| 1001 | port        | 4569                 |     0 |
| 1001 | type        | friend               |     0 |
| 1001 | host        | dynamic              |     0 |
| 1001 | context     | from-internal        |     0 |
| 1002 | callerid    | device <1002>        |     0 |
| 1002 | account     | 1002                 |     0 |
| 1002 | permit      | 0.0.0.0/0.0.0.0      |     0 |
| 1002 | deny        | 0.0.0.0/0.0.0.0      |     0 |
| 1002 | mailbox     | 1002@device          |     0 |
| 1002 | accountcode |                      |     0 |
| 1002 | dial        | IAX2/1002            |     0 |
| 1002 | allow       |                      |     0 |
| 1002 | disallow    |                      |     0 |
| 1002 | qualify     | yes                  |     0 |
| 1002 | port        | 4569                 |     0 |
| 1002 | type        | friend               |     0 |
| 1002 | host        | dynamic              |     0 |
| 1002 | context     | from-internal        |     0 |
| 1002 | notransfer  | yes                  |     0 |
| 1002 | secret      | 1002                 |     0 |
| 1001 | notransfer  | yes                  |     0 |
| 1001 | secret      | 1001                 |     0 |
| 1002 | setvar      | REALCALLERIDNUM=1002 |     0 |
| 1002 | record_in   | Adhoc                |     0 |
| 1002 | record_out  | Adhoc                |     0 |
| 1001 | record_out  | Adhoc                |     0 |
+------+-------------+----------------------+-------+
					</pre>
					</li>
					<li>database log<br />
					<pre>
                     25 Query       INSERT INTO users (extension,password,name,voicemail,ringtimer,noanswer,recording,outboundcid,sipname) values ("3232", "", "3232", "novm", "0", "", "out=Adhoc|in=Adhoc", "3232", "")
                     25 Query       INSERT INTO devices (id,tech,dial,devicetype,user,description,emergency_cid) values ("3232","iax2","IAX2/3232","fixed","3232","3232","")
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','secret','3232')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','notransfer','yes')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','context','from-internal')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','host','dynamic')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','type','friend')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','port','4569')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','qualify','yes')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','disallow','')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','allow','')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','dial','IAX2/3232')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','accountcode','')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','mailbox','3232@device')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','deny','0.0.0.0/0.0.0.0')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','permit','0.0.0.0/0.0.0.0')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','account','3232')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','callerid','device <3232>')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','setvar','REALCALLERIDNUM=3232')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','record_in','Adhoc')
                     25 Query       INSERT INTO iax (id, keyword, data) values ('3232','record_out','Adhoc')
					</pre>
					</li>
					</ul>
				</li>
				</ul>
			</li>
			<ul>
				<ul>
					<li>files<br />
					<pre>
; /etc/asterisk/iax_additional.conf

[1001]
deny=0.0.0.0/0.0.0.0
type=friend
setvar=REALCALLERIDNUM=1001
secret=1001
qualify=yes
port=4569
permit=0.0.0.0/0.0.0.0
transfer=no
mailbox=1001@device
host=dynamic
dial=IAX2/1001
context=from-internal
callerid=device <1001>
accountcode=
</pre>
						<br />
					</li>
				</ul>
			</ul>
			<li>Trunks add</li>
			<ul>
				<ul>
					<li>SIP<ul>
						<li>database table<br />
						<pre>
[root@elastix ~]# $MYSQL -e "use asterisk; select * from sip;"
+------+-------------+-----------------+-------+
| id   | keyword     | data            | flags |
+------+-------------+-----------------+-------+
| 5001 | record_in   | Adhoc           |     0 |
| 5001 | callerid    | device <5001>   |     0 |
| 5001 | account     | 5001            |     0 |
| 5001 | permit      | 0.0.0.0/0.0.0.0 |     0 |
| 5001 | deny        | 0.0.0.0/0.0.0.0 |     0 |
| 5001 | mailbox     | 5001@device     |     0 |
| 5002 | record_in   | Adhoc           |     0 |
| 5002 | account     | 5002            |     0 |
| 5002 | callerid    | device <5002>   |     0 |
| 5002 | permit      | 0.0.0.0/0.0.0.0 |     0 |
| 5002 | deny        | 0.0.0.0/0.0.0.0 |     0 |
| 5002 | mailbox     | 5002@device     |     0 |
| 5002 | accountcode |                 |     0 |
| 5002 | allow       |                 |     0 |
| 5002 | dial        | SIP/5002        |     0 |
| 5001 | accountcode |                 |     0 |
| 5001 | dial        | SIP/5001        |     0 |
| 5001 | allow       |                 |     0 |
| 5001 | disallow    |                 |     0 |
| 5001 | pickupgroup |                 |     0 |
| 5001 | callgroup   |                 |     0 |
| 5001 | qualify     | yes             |     0 |
| 5001 | port        | 5060            |     0 |
| 5001 | nat         | yes             |     0 |
| 5001 | type        | friend          |     0 |
| 5001 | host        | dynamic         |     0 |
| 5001 | context     | from-internal   |     0 |
| 5001 | canreinvite | no              |     0 |
| 5001 | dtmfmode    | rfc2833         |     0 |
| 5001 | secret      | 5001            |     0 |
| 5002 | disallow    |                 |     0 |
| 5002 | pickupgroup |                 |     0 |
| 5002 | callgroup   |                 |     0 |
| 5002 | qualify     | yes             |     0 |
| 5002 | port        | 5060            |     0 |
| 5002 | nat         | yes             |     0 |
| 5002 | type        | friend          |     0 |
| 5002 | host        | dynamic         |     0 |
| 5002 | context     | from-internal   |     0 |
| 5002 | canreinvite | no              |     0 |
| 5002 | dtmfmode    | rfc2833         |     0 |
| 5002 | secret      | 5002            |     0 |
| 5001 | record_out  | Adhoc           |     0 |
| 5002 | record_out  | Adhoc           |     0 |
+------+-------------+-----------------+-------+
						</pre>
							</li>
						<li>database log<br />
						<pre>
						
                      3 Query       INSERT INTO globals (variable, value) values ('OUT_3','SIP/trunksip')
                      3 Query       INSERT INTO globals (variable, value) values ('OUTPREFIX_3','')
                      3 Query       INSERT INTO globals (variable, value) values ('OUTMAXCHANS_3','')
                      3 Query       INSERT INTO globals (variable, value) values ('OUTCID_3','')
                      3 Query       INSERT INTO globals (variable, value) values ('OUTKEEPCID_3','off')
                      3 Query       INSERT INTO globals (variable, value) values ('OUTFAIL_3','')
                      3 Query       INSERT INTO globals (variable, value) values ('OUTDISABLE_3','off')
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('99993','account','trunksip',2)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('99993','host','sip1',3)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('99993','username','sip12',4)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('99993','secret','sip3',5)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('99993','type','peer',6)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('999993','account','contextsip',2)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('999993','secret','sip4',3)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('999993','type','user',4)
                      3 Query       INSERT INTO sip (id, keyword, data, flags) values ('999993','context','from-trunk',5)
							</pre>
							</li>
							<li>files<br />
							Ovo je gresska?!?!?!
							<pre>
;/etc/asterisk/sip_additional.conf

[5001]
deny=0.0.0.0/0.0.0.0
type=friend
secret=5001
qualify=yes
port=5060
pickupgroup=
permit=0.0.0.0/0.0.0.0
nat=yes
mailbox=5001@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/5001
context=from-internal
canreinvite=no
callgroup=
callerid=device <5001>
accountcode=
call-limit=50

							</pre>
							</li>
						</ul>
					</li>
					<li>IAX
						<ul>
							<li>database table<br />
								<pre>
[root@elastix ~]# $MYSQL -e "use asterisk; select * from iax;"
+--------+-------------+----------------------+-------+
| id     | keyword     | data                 | flags |
+--------+-------------+----------------------+-------+
| 1001   | record_in   | Adhoc                |     0 |
| 1001   | setvar      | REALCALLERIDNUM=1001 |     0 |
| 1001   | callerid    | device <1001>        |     0 |
| 1001   | account     | 1001                 |     0 |
| 1001   | permit      | 0.0.0.0/0.0.0.0      |     0 |
| 1001   | deny        | 0.0.0.0/0.0.0.0      |     0 |
| 1001   | mailbox     | 1001@device          |     0 |
| 1001   | accountcode |                      |     0 |
| 1001   | dial        | IAX2/1001            |     0 |
| 1001   | allow       |                      |     0 |
| 1001   | disallow    |                      |     0 |
| 1001   | qualify     | yes                  |     0 |
| 1001   | port        | 4569                 |     0 |
| 1001   | type        | friend               |     0 |
| 1001   | host        | dynamic              |     0 |
| 1001   | context     | from-internal        |     0 |
| 1002   | callerid    | device <1002>        |     0 |
| 1002   | account     | 1002                 |     0 |
| 1002   | permit      | 0.0.0.0/0.0.0.0      |     0 |
| 1002   | deny        | 0.0.0.0/0.0.0.0      |     0 |
| 1002   | mailbox     | 1002@device          |     0 |
| 1002   | accountcode |                      |     0 |
| 1002   | dial        | IAX2/1002            |     0 |
| 1002   | allow       |                      |     0 |
| 1002   | disallow    |                      |     0 |
| 1002   | qualify     | yes                  |     0 |
| 1002   | port        | 4569                 |     0 |
| 1002   | type        | friend               |     0 |
| 1002   | host        | dynamic              |     0 |
| 1002   | context     | from-internal        |     0 |
| 1002   | notransfer  | yes                  |     0 |
| 1002   | secret      | 1002                 |     0 |
| 1001   | notransfer  | yes                  |     0 |
| 1001   | secret      | 1001                 |     0 |
| 1002   | setvar      | REALCALLERIDNUM=1002 |     0 |
| 1002   | record_in   | Adhoc                |     0 |
| 1002   | record_out  | Adhoc                |     0 |
| 1001   | record_out  | Adhoc                |     0 |
| 99992  | account     | trunkijax            |     2 |
| 99992  | host        | moljac1              |     3 |
| 99992  | username    | moljac2              |     4 |
| 99992  | secret      | moljac3              |     5 |
| 99992  | type        | peer                 |     6 |
| 999992 | account     | contextijax          |     2 |
| 999992 | secre       | tmoljac              |     3 |
| 999992 | type        | user                 |     4 |
| 999992 | context     | from-trunk           |     5 |
+--------+-------------+----------------------+-------+
								</pre><br />
							</li>
							<li>database log
								<br />
								<pre>
                     12 Query       INSERT INTO globals (variable, value) values ('OUT_4','IAX2/dsa')
                     12 Query       INSERT INTO globals (variable, value) values ('OUTPREFIX_4','')
                     12 Query       INSERT INTO globals (variable, value) values ('OUTMAXCHANS_4','')
                     12 Query       INSERT INTO globals (variable, value) values ('OUTCID_4','')
                     12 Query       INSERT INTO globals (variable, value) values ('OUTKEEPCID_4','off')
                     12 Query       INSERT INTO globals (variable, value) values ('OUTFAIL_4','')
                     12 Query       INSERT INTO globals (variable, value) values ('OUTDISABLE_4','off')
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('99994','account','dsa',2)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('99994','host','***provider ip address***',3)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('99994','username','***userid***',4)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('99994','secret','***password***',5)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('99994','type','peer',6)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('999994','account','fsd',2)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('999994','secret','***password***',3)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('999994','type','user',4)
                     12 Query       INSERT INTO iax (id, keyword, data, flags) values ('999994','context','from-trunk',5)
  								</pre>
								</li>
							<li>files<br />
							<pre>
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make    ;
; custom modifications, details at: http://freepbx.org/configuration_files       ;
;--------------------------------------------------------------------------------;
;

[1001]
deny=0.0.0.0/0.0.0.0
type=friend
setvar=REALCALLERIDNUM=1001
secret=1001
qualify=yes
port=4569
permit=0.0.0.0/0.0.0.0
transfer=no
mailbox=1001@device
host=dynamic
dial=IAX2/1001
context=from-internal
callerid=device <1001>
accountcode=

[1002]
deny=0.0.0.0/0.0.0.0
type=friend
setvar=REALCALLERIDNUM=1002
secret=1002
qualify=yes
port=4569
permit=0.0.0.0/0.0.0.0
transfer=no
mailbox=1002@device
host=dynamic
dial=IAX2/1002
context=from-internal
callerid=device <1002>
accountcode=

[contextijax]
secre=tmoljac
type=user
context=from-trunk

[trunkijax]
host=moljac1
username=moljac2
secret=moljac3
type=peer
							</pre>
							</li>
						</ul>
					</li>
					
				</ul>
			</ul>
			<li>Ring Groups
				<ul>
					<li>database table<br />
					</li>
					<li>dataase log<br />
					<pre>
						42 Query       INSERT INTO ringgroups (grpnum, strategy, grptime, grppre, grplist, annmsg_id, postdest, description, alertinfo, needsconf, remotealert_id, toolate_id, ringing, cwignore, cfignore) VALUES ('55556', 'ringall', 20, '', '1002-1111-3232', '', '', 'kokokoo', '', '', '', '', 'Ring', '', '')
					</pre>
					</li>
					<li>files <br />
					<pre>
					</pre>
					</li>
				</ul>
			</li>
			<li>Incomming Routes<ul>
				<li>database table<br />
				</li>
				<li>database log<br />
				</li>
				<li>files<br />
				<pre>
                     51 Query       INSERT INTO cidlookup_incoming (cidlookup_id, extension, cidnum) VALUES ("0", "38517779999", "")
                     51 Query       INSERT INTO incoming (cidnum,extension,destination,faxexten,faxemail,answer,wait,privacyman,alertinfo, ringing, mohclass, description, grppre, delay_answer, pricid) values ('','38517779999','ext-group,600,1','default','','0','','0','', '', 'default', '', '', '', '')
				</pre>
				</li>
				</ul>
			</li>
		</ul>
		<h2>
			&nbsp;</h2>

		<p>
			&nbsp;</p>
		<p>
			&nbsp;</p>
			<pre>
[6666]
deny=0.0.0.0/0.0.0.0
type=friend
secret=6666
qualify=yes
port=5060
pickupgroup=
permit=0.0.0.0/0.0.0.0
nat=yes
mailbox=6666@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/6666
context=from-internal
canreinvite=no
callgroup=
callerid=device <6666>
accountcode=
call-limit=50
		
			</pre>
		<h3>
			IAX2</h3>
		<h2>
			Trunks</h2>
		<h3>
			SIP</h3>
		<h3>
			IAX</h3>
<pre>

[contextijax]
secre=tmoljac
type=user
context=from-trunk

[trunkijax]
host=moljac1
username=moljac2
secret=moljac3
type=peer

</pre>		<h2>
			Inbound Routes</h2>
		<h2>
			Outbound Routes</h2>
		<p>
			&nbsp;</p>
		<li>
		<h2>
			Older stuff</h2>
			
		<!-- HolisticWare.Text.End-->


		<div>
		<a href="http://validator.w3.org/check?uri=referer">XHTML 1.1</a> 
		<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
		</div>
		<div>
		<div style="border-style: double; border-width: medium; border-color: inherit;">
		.:End:.
		</div>
		<a 
			href="http://validator.w3.org/check?uri=referer">
			<object
			data="http://www.w3.org/Icons/valid-xhtml10-blue"
			standby="Valid XHTML 1.0 Transitional" 
			title="Valid XHTML 1.0 Transitional" 
			height="31" width="88" 
			/>
		</a>
    <a 
			href="http://jigsaw.w3.org/css-validator/validator?uri=referer">
			<object 
				data="http://www.w3.org/Icons/valid-css-blue" 
				standby="Valid CSS!"
				title= "Valid CSS!"
				height="31" width="88"
		/>
    </a>
		</div>
	    


</body>
</html>